/***************************************************************
 * Name:      ProjectMain.h
 * Purpose:   Defines Application Frame
 * Author:     ()
 * Created:   2012-01-12
 * Copyright:  ()
 * License:
 **************************************************************/

#ifndef PROJECTMAIN_H
#define PROJECTMAIN_H

//(*Headers(ProjectFrame)
#include <wx/notebook.h>
#include <wx/sizer.h>
#include <wx/stattext.h>
#include "../include/spinctld.h"
#include <wx/menu.h>
#include <wx/textctrl.h>
#include <wx/checkbox.h>
#include <wx/panel.h>
#include <wx/filedlg.h>
#include "..\include\TimeLine.h"
#include "../include/toggle.h"
#include "../include/BoneTreeCtrl.h"
#include <wx/button.h>
#include <wx/frame.h>
#include <wx/statusbr.h>
//*)

#include "../include/Config.h"
#include "../include/TimeLine.h"
#include "../include/NewFileDialog.h"
#include "../include/BoneManager.h"

class ProjectFrame: public wxFrame
{
    public:

        ProjectFrame(wxWindow* parent,wxWindowID id = -1);
        virtual ~ProjectFrame();

        void setBoneInfo(double loopsRelative, double angleMin, double angleMax, wxString name, bool motion, wxString spriteFileName, wxPoint spritePos);
        void setBoneLoops(double loopsRelative);
        int modeType();
        void enableAddBoneMode( bool value );
        TimeLine* getTimeLine() const;

    private:

        //(*Handlers(ProjectFrame)
        void OnQuit(wxCommandEvent& event);
        void OnAbout(wxCommandEvent& event);
        void OnClose(wxCloseEvent& event);
        void OnNewFile(wxCommandEvent& event);
        void OnEraseBackground(wxEraseEvent& event);
        void OnResize(wxSizeEvent& event);
        void OnTabsPageChanged(wxNotebookEvent& event);
        void OnTabsPageChanged1(wxNotebookEvent& event);
        void OnSpinButton1Change(wxSpinEvent& event);
        void OnTextCtrl1Text(wxCommandEvent& event);
        void OnBrowseClick(wxCommandEvent& event);
        void OnMenuSaveAs(wxCommandEvent& event);
        void OnMenuOpen(wxCommandEvent& event);
        void OnMenuItemImport(wxCommandEvent& event);
        //*)

        void CanvasUpdate(wxUpdateUIEvent& event);
        void updateAngleMin(wxSpinEvent& event);
        void updateAngleMax(wxSpinEvent& event);
        void updateLoops(wxSpinEvent& event);
        void updateBoneName(wxCommandEvent& event);
        void updateSpriteXY(wxCommandEvent& event);
        void updateMotion(wxCommandEvent& event);
        void addBoneButtonToggle(wxCommandEvent& event);
        void playButtonToggle(wxCommandEvent& event);
        void pauseButtonToggle(wxCommandEvent& event);
        void stopButtonToggle(wxCommandEvent& event);

        void newBoneManager();

        //(*Identifiers(ProjectFrame)
        static const long ID_ADD_BONE_BUTTON;
        static const long ID_TIMELINE;
        static const long ID_BONE_TREE;
        static const long ID_STATICTEXT1;
        static const long ID_TEXTCTRL2;
        static const long ID_STATICTEXT6;
        static const long ID_MIN_SPIN;
        static const long ID_STATICTEXT7;
        static const long ID_MAX_SPIN;
        static const long ID_STATICTEXT8;
        static const long ID_CUSTOM1;
        static const long ID_STATICTEXT9;
        static const long ID_CHECKBOX1;
        static const long ID_PANEL1;
        static const long ID_STATICTEXT2;
        static const long ID_TEXTCTRL1;
        static const long ID_BUTTON1;
        static const long ID_STATICTEXT3;
        static const long ID_TEXTCTRL3;
        static const long ID_STATICTEXT4;
        static const long ID_TEXTCTRL4;
        static const long ID_PANEL2;
        static const long ID_TABS;
        static const long ID_CUSTOM3;
        static const long ID_CUSTOM2;
        static const long ID_CUSTOM4;
        static const long idMenuNewFile;
        static const long idMenuSaveAs;
        static const long idMenuOpen;
        static const long idMenuImport;
        static const long idMenuQuit;
        static const long idMenuAbout;
        static const long ID_STATUSBAR1;
        //*)

        static const long ID_CANVAS;


    wxBoxSizer* BoxSizer4;
    wxFlexGridSizer* FlexGridSizer4;
    wxBoxSizer* BoxSizer5;
    wxMenuItem* MenuItem2;
    wxFlexGridSizer* FlexGridSizer3;
    wxMenuItem* MenuItem1;
    wxFlexGridSizer* FlexGridSizer2;
    wxBoxSizer* BoxSizer2;
    wxMenu* Menu1;
    wxGridSizer* GridSizer1;
    wxBoxSizer* BoxSizer1;
    wxMenuBar* MenuBar1;
    wxFlexGridSizer* FlexGridSizer6;
    wxFlexGridSizer* FlexGridSizer1;
    wxBoxSizer* BoxSizer3;
    wxMenu* Menu2;

        //(*Declarations(ProjectFrame)
        wxStaticText* StaticText9;
        wxCustomButton* PlayButton;
        wxTextCtrl* TextCtrl4;
        wxSpinCtrlDbl* minAngleSpin;
        TimeLine* timeLine;
        wxMenuItem* MenuItem5;
        wxStaticText* StaticText2;
        wxFileDialog* FileDialogOpen;
        wxFileDialog* FileDialogSave;
        wxNotebook* Tabs;
        wxButton* Button1;
        wxFileDialog* SpritePicker;
        wxStaticText* StaticText6;
        wxMenuItem* MenuItem4;
        wxStaticText* StaticText8;
        wxSpinCtrlDbl* LoopsSpinCrtl;
        wxPanel* Panel1;
        wxStaticText* StaticText1;
        wxSpinCtrlDbl* maxAngleSpin;
        wxStaticText* StaticText3;
        wxCheckBox* CheckBox1;
        wxCustomButton* StopButton;
        wxMenuItem* MenuItem3;
        wxCustomButton* addBoneButton;
        wxStaticText* StaticText7;
        wxCustomButton* PauseButton;
        BoneTreeCtrl* boneTreeCtrl;
        wxStatusBar* StatusBar1;
        wxMenuItem* MenuItem6;
        wxTextCtrl* TextCtrl2;
        wxTextCtrl* TextCtrl1;
        wxPanel* Panel2;
        wxStaticText* StaticText4;
        wxTextCtrl* TextCtrl3;
        //*)

        Config* config;
        BoneManager* boneManager;
        wxValidator* numberValidator;
        NewFileDialog* newFileDialog;

        bool addBoneMode;
        bool isPlaying;

        DECLARE_EVENT_TABLE()
};

#endif // PROJECTMAIN_H
